package com.wenson.creational.builder;

/**
 * @ClassName: ApartmentBuilder
 * @Author: luowangcheng
 * @Date: 2024/6/13 7:40
 * @Description:公寓施工方
 */
public class ApartmentBuilder implements Builder {
    private Building apartment;

    public ApartmentBuilder() {
        this.apartment = new Building();
    }

    @Override
    public void buildBasement() {
        System.out.println("深挖地基，修剪地下车库，部署管道、线缆、风道");
        apartment.setBasement("|____________|\n");
    }

    @Override
    public void buildWall() {
        System.out.println("搭建多层建筑框架，建造电梯井，钢筋混凝土浇灌");
        for (int i = 0; i < 8; i++) {
            apartment.setWall("| 口 口 口 口 |\n");
        }
    }

    @Override
    public void buildRoof() {
        System.out.println("封顶，部署通风井，做防水层，保温层");
        apartment.setBasement("|````````````|\n");
    }

    @Override
    public Building getBuilding() {
        return apartment;
    }
}
